# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=lha
pkgver=1.14.20211125
pkgrel=5
pkgdesc="Compression and archive utility for LH-7 format archives"
url="https://github.com/jca02266/lha/"
arch="all"
license="custom"
subpackages="$pkgname-doc"
makedepends="autoconf automake libtool"
checkdepends="bash"
source="$pkgname-$pkgver.tar.gz::https://github.com/jca02266/lha/archive/refs/tags/release-${pkgver#1.14.}.tar.gz
	gcc14.patch"
builddir="$srcdir/lha-release-${pkgver#1.14.}"

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

check() {
	make check
}

package() {
	make "DESTDIR=$pkgdir" install
}

sha512sums="
fb72b6c597701c41b34723218d78002d3502034ddf429f55b6ddda5925dd48df63913048d99f7834399cca4eaa28423e104b881082fb5ace8e6e998b97b2e889  lha-1.14.20211125.tar.gz
0edd18654e2ac57d790c42b7ce795885d1950b0ec93a8b567f6946356eb51123a4097e69057de658bb8864878e83ec96966c1dcaa29fa349d0a9c30daed48887  gcc14.patch
"
